<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!--首页 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>二手网，二货尽在此处！</title>
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/homepageAndDetail/css/homepage.css">
<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath }/homepageAndDetail/css/topbar.css">
<script type="text/javascript" src="${pageContext.request.contextPath }/homepageAndDetail/js/jquery-2.1.1.js"></script>

<link rel="stylesheet" href="${pageContext.request.contextPath }/homepageAndDetail/css/bootstrap_v3_3.css">
<style type="text/css">
</style>

<script type="text/javascript">
	
	var type="";
	var price="";
	var jq=$.noConflict();
	jq(function(){
		//判断是否登录
		var flag=jq("#hidden").val().length;
		if(flag==0){
			jq("#commonTopbar_login").prepend("<a href='${pageContext.request.contextPath }/user_manage/user_login.jsp'>登录</a><span class='gap'>|</span>");
		}
		
		//动态加载商品类型
		
		jq.ajax({
   			type: "get",
   			url: "${pageContext.request.contextPath }/GetTypeServlet",
   			data:{
   				
   			},
  			success:function(response,status,xhr){
    			var jsonStr=xhr.responseText;
				var types=eval('('+jsonStr+')');
				for(var i=0;i<types.length;i++){
					jq("#type").append("<li><a class='type'>"+types[i]+"</a></li>");
				}
				
   			}
		}); 
		
		//进去首页后页面异步加载商品
		
		jq.ajax({
				type: "POST",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
			
			
			
		
		//综合操作
		jq("#composite").click(function(){
			
			jq.ajax({
				type:"POST",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
   				success:function(response,status,xhr){
   				
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
				
   				}
			});
		});
		
		
		
		//获取搜索框中的值,根据关键词进行模糊查询
		jq(".btnall").click(function(){
			
			var keyword=jq("#keyword").val();
			jq(":input[name=key]").val(keyword);
			jq.ajax({
				type:"POST",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:keyword
   				},
   				success:function(response,status,xhr){
   				
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
				
   				}
			});
		});
		
		//价格排序条件被选中
		jq(".price").click(function(){
			pricedata=jq(this).html();
			//给隐藏域赋值
			jq(":input[name='price']").val(pricedata);
			typedata=jq(":input[name=type]").val();
			//viewdata=jq(":input[name=view]").val();
			keydata=jq(":input[name=key]").val();
			jq.ajax({
				type:"get",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:keydata,
   					//view:viewdata,
   					type:typedata,
   					price:pricedata
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
				
   				}
			});
		});
		
		//分类条件被选中
		 jq(document).on("click",".type",function(){
        	typedata=jq(this).html();
        	
			//给隐藏域赋值
			jq(":input[name='type']").val(typedata);
			viewdata=jq(":input[name=view]").val();
			keydata=jq(":input[name=key]").val();
			pricedata=jq(":input[name=price]").val();
			jq.ajax({
				type:"get",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:keydata,
   					view:viewdata,
   					type:typedata,
   					price:pricedata
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
    	});
		
		
		//人气排序条件被选中
		jq(".view").click(function(){
			viewdata=jq(this).html();
			
			//给隐藏域赋值
			jq(":input[name='view']").val(viewdata);
			typedata=jq(":input[name=type]").val();
			//pricedata=jq(":input[name=price]").val();
			keydata=jq(":input[name=key]").val();
			jq.ajax({
				type:"get",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:keydata,
   					view:viewdata,
   					type:typedata
   					//price:pricedata
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
				
   				}
			});
		});
		
		//点击上一页
		jq("#prepage").click(function(){
		
			var currentpage=parseInt($("#currentpage").val());
			if(currentpage<=1){
				currentpage=1;
				alert("当前页已经是第一页");
			}else{
				currentpage=currentpage-1;
				
				jq.ajax({
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					currentPage:currentpage
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
		}
			
	});
		
		
		//点击下一页
		jq("#nextpage").click(function(){
			var currentpage=parseInt($("#currentpage").val());
			var totalpage=parseInt($("#totalpage").val());
			if(currentpage>=totalpage){
				currentpage=totalpage;
				alert("当前页已经是最后一页");
			}else{
				currentpage=currentpage+1;
				jq.ajax({
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					currentPage:currentpage
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
		}
			
	});
	
	//热搜自行车
	$(".car").click(function(){
			jq(":input[name=key]").val("自行车");
			jq.ajax({
				type:"POST",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:"自行车"
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
	});
	
	
	//热搜手机
	$(".phone").click(function(){
			jq(":input[name=key]").val("手机");
			jq.ajax({
				type:"POST",
				url:"SearchAllGoods",
				data:{
   					key:"手机"
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
	});
	
	//热搜电脑
	$(".computer").click(function(){
			jq(":input[name=key]").val("电脑");
			jq.ajax({
				type:"POST",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:"电脑"
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
	});
		
		
	//热搜书籍
	$(".book").click(function(){
			jq(":input[name=key]").val("书");
			jq.ajax({
				type:"POST",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:"书"
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
	});
	
	//热搜耳机
	$(".headset").click(function(){
			jq(":input[name=key]").val("耳机");
			jq.ajax({
				type:"POST",
				url:"${pageContext.request.contextPath }/SearchAllGoods",
				data:{
   					key:"耳机"
   				},
   				success:function(response,status,xhr){
    				var page=xhr.responseText;
					var pagedata=eval('('+page+')');
					jq("#currentpage").val(pagedata.currentPage);
					jq("#totalpage").val(pagedata.totalPage);
					jq(".row").empty();
					for(var i=0;i<pagedata.goodsList.length;i++){
       					jq(".row").append("<div style='margin-left:34px;margin-right:34px;'><div class='col-sm-6 col-md-3'><div class='thumbnail'><img style='width:200px;height:150px;' src='${pageContext.request.contextPath}/"+pagedata.goodsList[i].goodsImg+"'><div class='caption'><h3 style='color:#16a085'>¥&nbsp"+pagedata.goodsList[i].goodsPrice+"</h3><p style='color:#808080'>"+pagedata.goodsList[i].goodsName+"</p><p><a class='btn btn-primary' href='${pageContext.request.contextPath }/UpdateView?goodsid="+pagedata.goodsList[i].goodsId+"' style='background:#16a085' role='button'>详情</a></p><p>浏览量："+pagedata.goodsList[i].goodsPageview+"&nbsp;&nbsp;&nbsp;&nbsp;"+pagedata.goodsList[i].issueTime+"</p></div></div></div></div>");
					}
					
   				}
			});
	});
	
	
	
	
});

function isLogin(obj){
	var flag=jq("#hidden").val().length;
		if(flag==0){
			window.location="${pageContext.request.contextPath }/user_manage/user_login.jsp";
		}else{
			if($(obj).text()=="发布商品"){
				
				window.location="${pageContext.request.contextPath }/homepageAndDetail/fabu.jsp";
			}
			if($(obj).text()=="个人中心"){
				
				window.location="${pageContext.request.contextPath }/person_center/right_menu.jsp";
			}
			if($(obj).text()=="购物车"){
				window.location="${pageContext.request.contextPath}/carInfoServlet";
			}
		}
}



</script>

</head>
<body>

<div id="commonTopbar" class="commonTopbar">
   <div id="commonTopbar_welcome" class="bar_left" style="margin-left:50px">
     <label><font size="4" color="skyblue" >${user_login.userName }</font>&nbsp;&nbsp;欢迎来到二手网！</label> 
   </div>
   <div class="bar_right" style="position:relative;margin-right:50px">
        <div id="commonTopbar_login">
           <input type="hidden" id="hidden" value="${user_login.userName }" >
            
        </div>   
        <div onclick="isLogin(this);" class="shopping_cart"><a target="_blank">购物车</a></div>   
        <div onclick="isLogin(this);" class="post_order"><a target="_blank">发布商品</a></div>        
        <div id="commonTopbar_my58menu" onclick="isLogin(this);" class="haschild"><a id="commonTopbar_tomy58" target="_blank">个人中心</a></div>
   </div> 
  
</div>
<div id="headerWrap">
    <div id="homeWrap" class="wrapper">
        <div id="brand_top_banner" style="display:none"></div>
        <div id="header">
            <div id="headerinside">
                <a target="_self" id="logo"></a><div id="brand_mini_banner" class="search-no" style="display:none"></div>
             <!-- 
                <form onsubmit='_gaq.push(["pageTracker._trackEvent", "home", "search_top_click", "/gz/index/"]);var r=true;try{b_query(); r=false;}catch(e){};return r;' action="/sou/" target="_self">
               --> 
                <div id="searchbar" style="margin-top:15px">
               
                     <div id="saerkey">
                        <span id="key">
                        	<input type="text" id="keyword" name="key" class="keyword" placeholder="找你要的二货" onBlur="win.closeToolTipWindow();if(this.value=='')this.value='找你要的二货',this.className='keyword'" onKeyUp="win.GetContentData();" onFocus="if(this.value=='找你要的二货')this.value='',this.className='keyword2'" autocomplete="off"/>
                        </span>
                   	</div>
                     
                     <!--隐藏域  把查询的条件放在隐藏域中   点击提交把条件带过去查询-->
                    <div class="inputcon" style="color:red;">
                    		<input type="hidden" name="key" value="${search.keyword }" />
                    		<input type="hidden" name="view" value="${search.view }" />
                    		<input type="hidden" name="price" value="${search.price }"/>
                    		<input type="hidden" name="type" value="${search.type }"/>
                    	
                      		<input  type="button" name="button" id="searchbtn" class="btnall"  value="搜&nbsp;索" onMouseMove="this.className='btnal2'" onMouseOut="this.className='btnall'" tongji_tag="pc_home_search" onclick="if(document.getElementById('keyword').value=='找工作 找房子 找服务')return false;" />
                    		
                    	
                   
                    <!--隐藏域  把查询的条件放在隐藏域中-->
                    </form>
                    
                    
                    <div id="hotwords" class="search-no clear">
                        <span id="hot"></span>
                        <span id="hot2">
                        	<a class="car">自行车</a>
                        	<a class="phone">手机</a>
                        	<a class="computer">电脑</a>
                        	<a class="book">书籍</a>
                        	<a class="headset">耳机</a>
                        </span>
                    </div>
                </div>
                <!--  
                </form>
               -->
            </div>
        </div>
        <ul class="navcon" id="nav" style="margin-top:20px">
            <li id="homeNav" class="navBg fl"><a class="navWit" href="/" target="_self">首页</a></li>
        </ul>
    </div>
</div>
<nav class="navbar navbar-default" style="margin-top:-8px;margin-left:48px;margin-right:48px">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" style="font-size:15px" id="composite">综合</a>
      
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav">
      
      <!--人气排序  start-->
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">人气 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a class="view">从低到高</a></li>
            <li><a class="view">从高到低</a></li>
          </ul>
        </li>
         <!--人气排序  end-->
         
         <!--价格排序 start -->
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">价格 <span class="caret"></span></a>
          <ul class="dropdown-menu">
            <li><a class="price">从低到高</a></li>
            <li><a class="price">从高到低</a></li>
          </ul>
        </li>
        <!--价格排序end-->
      
      
      	<!--商品分类 start  从数据库动态查询 -->
        <li class="dropdown">
          <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">分类 <span class="caret"></span></a>
          <ul class="dropdown-menu" id="type">
           	
          </ul>
        </li>
        <!--商品分类   end -->
        
      </ul>     
    </div>
  </div>
</nav>

<!--数据库动态添加商品 (ajax异步实现)start  -->
<div class="row" style="margin-left:34px;margin-right:34px;">
	
</div>
<!--数据库动态添加商品 end -->

<!-- 分页 start -->
<nav style="text-align: center">
   <ul class="pagination pagination-lg">
	<li><a id="prepage">&laquo;上一页</a></li>
	<li><a>当前页<input type="text" id="currentpage" disabled="disabled" style="height:25px;width:50px;" value="${page.currentPage }"></a></li>
	<li><a>共<input type="text" id="totalpage" disabled="disabled" style="height:25px;width:50px;" value="${page.totalPage }">页</a></li>
	<li><a id="nextpage">下一页&raquo;</a></li>
  </ul>
</nav>
<!-- 分页 end -->

<script src="${pageContext.request.contextPath }/homepageAndDetail/js/jquery.min.js"></script>
<script src="${pageContext.request.contextPath }/homepageAndDetail/js/bootstrap.min.js"></script> 
</body></html>